﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WCS.Entities
{
    public class WarningInfo
    {
        public WarningInfo()
        {

        }

        public WarningInfo(string message, string code, string title)
        {
            Message = message;
            Code = code;
            Title = title;
        }

        public string Message { get; set; }

        public DateTime CreateTime { get; set; }

        public string Code { get; set; }

        public string Title { get; set; }

        public override bool Equals(object obj)
        {
            if (obj == null) return false;
            if (obj is WarningInfo)
            {
                var warn = obj as WarningInfo;
                return Message == warn.Message && Title == warn.Title;
            }
            else
            {
                return false;
            }
        }

        public override int GetHashCode()
        {
            return Title.GetHashCode() ^ Message.GetHashCode();
        }
    }
}
